package com.etu.jsonservices.dto;

/**
 * A verbose implementation of the {@link ErrorJSONResponse} which includes the
 * stack trace of the failed operation.
 * 
 * @author uye
 * 
 */
public class VerboseErrorJSONResponse extends ErrorJSONResponse {

	/**
	 * The stacktrace of the error.
	 */
	private String stacktrace;

	/**
	 * Creates an instance of an error response. Used to reply back to the
	 * client that the service failed its operation and supplies the error code
	 * and its description. Unlike {@link ErrorJSONResponse} however, this also
	 * includes the stack trace, useful while debugging the application during
	 * development.
	 * 
	 * @param originServiceName
	 *            The name of the original service invoked by the client
	 * @param errorCode
	 *            The specific error code that occurred
	 * @param description
	 *            A brief description of the error
	 * @param stacktrace
	 *            The associated stacktrace of the error
	 */
	public VerboseErrorJSONResponse(final String originServiceName,
			final String errorCode, final String description,
			final String stacktrace) {
		super(originServiceName, errorCode, description);
		this.stacktrace = stacktrace;
	}

	/**
	 * Retrieves the associated stacktrace of the error.
	 * @return The stacktrace
	 */
	public final String getStacktrace() {
		return stacktrace;
	}

}
